package com.bjypc.youth.web.json;

import java.util.ArrayList;
import java.util.List;

import com.bjypc.youth.entity.Person;
import com.bjypc.youth.entity.ResearchArticle;
import com.bjypc.youth.service.IPersonService;
import com.googlecode.jsonplugin.annotations.JSON;
import com.opensymphony.xwork2.ActionSupport;

public class PersonAction extends ActionSupport {

	/**
	 * serialVersionUID
	 */
	private static final long serialVersionUID = 907942649827468238L;
	private boolean success;
	private boolean failure;
	private IPersonService personService;
	private Person person;
	private List<ResearchArticle>  articleList=new ArrayList<ResearchArticle>();
	@Override
	public String execute() throws Exception {
		this.personService.save(this.person);
		this.person = new Person();
		this.success = true;
		this.failure = false;
		return SUCCESS;
	}

	public boolean isSuccess() {
		return success;
	}

	public void setSuccess(boolean success) {
		this.success = success;
	}

	public boolean isFailure() {
		return failure;
	}

	public void setFailure(boolean failure) {
		this.failure = failure;
	}
	@JSON(serialize=false)
	public IPersonService getPersonService() {
		return personService;
	}

	public void setPersonService(IPersonService personService) {
		this.personService = personService;
	}
	@JSON(serialize=false)
	public Person getPerson() {
		return person;
	}

	public void setPerson(Person person) {
		this.person = person;
	}

}
